Service discovery service REST API¶
Envoy expects the service discovery service to expose the following API (See Lyft’s reference implementation):
-
GET
/v1/registration/(string: service_name)
¶ Asks the discovery service to return all hosts for a particular service_name. service_name corresponds to the service_name cluster parameter. Responses use the following JSON schema:
{ "hosts": [] }
- hosts
- (Required, array) A list of hosts that make up the service.
Host JSON¶
{
"ip_address": "...",
"port": "...",
"tags": {
"az": "...",
"canary": "...",
"load_balancing_weight": "..."
}
}
- ip_address
- (required, string) The IP address of the upstream host.
- port
- (required, integer) The port of the upstream host.
- az
- (optional, string) The optional zone of the upstream host. Envoy uses the zone for various statistics and load balancing tasks documented elsewhere.
- canary
- (optional, boolean) The optional canary status of the upstream host. Envoy uses the canary status for various statistics and load balancing tasks documented elsewhere.
- load_balancing_weight
- (optional, integer) The optional load balancing weight of the upstream host, in the range 1 - 100. Envoy uses the load balancing weight in some of the built in load balancers.